package tech.aistar.mapper;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import tech.aistar.pojo.UserLove;
import java.util.List;

@Mapper
@Repository
public interface UserLoveMapper {
    @Select("select * from user_love where u_id=#{uid} and s_id=#{sid}")
    UserLove findByUserAndSid(@Param("uid") Integer uid, @Param("sid") Integer sid);
    @Select("select * from user_love ")
    List<UserLove> find();
    @Select("SELECT  COUNT(*) FROM user_love WHERE u_id =#{uid}  ;")
    int selectCount(Integer uid);
    @Insert("insert into user_love(song_title,singer_name,u_id,singer_avatar,create_time,s_id)" +
            " values(#{songTitle},#{singerName},#{uId},#{singerAvatar},#{createTime},#{sId})")
    int insetBySingerName(UserLove userLove);
    @Delete("delete from user_love where id=#{id} and u_id=#{uId}")
     void delete();
    @Select("select * from user_love where u_id=#{uid}")
    List<UserLove> findByUid(Integer uid);


}
